package com.example.demo.controller;

import com.example.demo.vo.UserVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

/**
 * //TODO 添加类/接口功能描述
 *
 * @author 刘朋
 * <br/>date 2021-09-06
 */
@Api(value = "测试参数校验", tags = "testValidated")
@RestController("test")
@RequestMapping("/testValidated")
@Validated
public class ValidatedTestController {


    @ApiOperation(value = "|test|")
    @PostMapping(consumes = APPLICATION_JSON_VALUE)
    public String test(@RequestBody @Valid List<UserVO> test) {
        return "成功";
    }


}
